
//myapp.controller('homeCtr',['$scope','$http',function($scope,$http){
//	$scope.data=null;
//	$http.get('http://h5.yztctech.net/api/axf/apihome.php')
//	.success(function(req){
//		$scope.data=req.data;
//	})
//}]);

myapp.controller('homeCtr',['$scope','$http','$timeout',function($scope,$http,$timeout){
	$scope.data = null;
	$http.get('http://h5.yztctech.net/api/axf/apihome.php')
	.success(function(req){
		$scope.data = req.data;
//		console.log(req);
		$timeout(function(){
			var mySwiper = new Swiper ('.swiper-container', {
			    direction: 'horizontal',
			    loop: true,
			    
			    // 如果需要分页器
			    pagination: '.swiper-pagination',
			    
			    // 如果需要前进后退按钮
			    nextButton: '.swiper-button-next',
			    prevButton: '.swiper-button-prev',
			    
			    // 如果需要滚动条
			    scrollbar: '.swiper-scrollbar',
			  })   
		},0);
	})
//	.error(function(){
//		console.log("错误");
//	})
	$scope.shop = [];
	$http.get('http://h5.yztctech.net/api/axf/apihomehot.php')
	.success(function(req){
		$scope.shop = req.data;
	})

}])


